<?php

namespace Acme\FirmsBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class FirmsType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('name', 'text')
            ->add('description', 'textarea')
            ->add('category', 'entity', array(
                'class' => 'AcmeFirmsBundle:CategoryFirms',
            ))
        ;
    }
    public function getDefaultOptions(array $options) {
        return array(
            'data_class'      => 'Acme\FirmsBundle\Entity\Firms',
            'csrf_protection' => true,
            'csrf_field_name' => '_token',
            // a unique key to help generate the secret token
            'intention'       => 'id',
        );
    }

    public function getName()
    {
        return 'acme_firmsbundle_firmstype';
    }
}
